package net.asfun.jvalog.misc;

public class StringUtil {

	public static String join(String[] array, String linker) {
		StringBuffer buff = new StringBuffer();
		for(int i=0; i<array.length; i++) {
			buff.append(array[i]);
			if (i < array.length - 1) {
				buff.append(linker);
			}
		}
		return buff.toString();
	}

	public static String abbreviate(String text, int length) {
		if( text.length() <= length ) {
			return text;
		}
		return text.substring(0, length) + "...";
	}
}
